package com.seo.pojo.lightpay;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

import lombok.Data;

@Data
public class LightPayCashier implements Serializable {

	private static final long serialVersionUID = 6725970347603247895L;
	private long id;
	private long transactionId;
	private String transactionCode;
	private String code;
	private int userId;
	private int parentUserId;
	private String payType;
	private String tradeType;
	private String payMode;
	private BigDecimal amount;
	private String remark;
	private String state;
	private String type;
	private String createTime;
	private String finishTime;
	private int version;
	private String payPwd;
	private String ip;
	public static String CODE_SUCCESS = "SUCCESS";
	private String wxUserToken;

	private Map<String, Object> otherParams = new HashMap<>();
	
	public enum State {
		no("00"), finish("01"), faile("02");
		String value;

		State(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}

		public void setValue(String value) {
			this.value = value;
		}

		public boolean equals(String value) {
			return this.value.equals(value);
		}
	}

	public enum PayMode {
		wechat("wechat"),alipay("alipay");
		String value;

		PayMode(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}

		public void setValue(String value) {
			this.value = value;
		}

		public boolean equals(String value) {
			return this.value.equals(value);
		}

		public static boolean isExists(String value) {
			try {
				PayMode.valueOf(value);
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}

	public enum PayValue {
		test("00"), normal("01");
		String value;

		PayValue(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}

		public void setValue(String value) {
			this.value = value;
		}

		public boolean equals(String value) {
			return this.value.equals(value);
		}
	}

}
